<?php

/**
 *  @FileComment            [品牌类型视图模型]
 *  @ProjectName             项目名称：shopFrame
 *  @FileName                   文件名称：BrandTypeViewModel.class.php
 *  @Author                       yuerengui <596580041@qq.com>
 *  @Date                          2014-10-15 11:49:30
 *  *
 */
class BrandTypeViewModel extends ViewModel {

        public $table = 'brand';
        public $view = array(
            'brand' => array('_type' => 'INNER'),
            'type' => array('_type' => 'INNER', '_on' => '__brand__.type_tid=type.tid')
        );

        public function get_data() {
                return $this->all();
        }

        public function get_one_data($bid) {
                return $this->where('bid=' . $bid)->find();
        }

        public function get_brand_data($where) {
                return $this->where($where)->all();
        }

}
